package com.yugao.fintech.antelope.filepreview.service.impl;

import com.yugao.fintech.antelope.filepreview.model.FileAttribute;
import com.yugao.fintech.antelope.filepreview.model.FilePreviewRS;
import com.yugao.fintech.antelope.filepreview.service.FilePreview;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

/**
 * EML文件处理
 */
@Service
public class EmlFilePreviewImpl implements FilePreview {
    private final PictureFilePreviewImpl pictureFilePreview;

    public EmlFilePreviewImpl(PictureFilePreviewImpl pictureFilePreview) {
        this.pictureFilePreview = pictureFilePreview;
    }

    @Override
    public FilePreviewRS filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
        pictureFilePreview.filePreviewHandle(url, model, fileAttribute);
        return FilePreviewRS.builder().type(EML_FILE_PREVIEW_PAGE).build();
    }
}
